﻿using System.Collections.Generic;
using ASER.BusinessLogic.BaseBusinessLogic;
using ASER.DataAccess.Security;
using ASER.DataEntity.Security;

namespace ASER.Business.Security
{
    /// <summary>
    /// 业务逻辑类:Sys_MenuBusiness
    /// 文  件  名:Sys_MenuBusiness.cs
    /// 说      明:06、菜单表(SysMenu)业务逻辑对象
    /// </summary>
    public class SysMenuBusiness : BaseBusinessLogic<SysmenuDataAccess>
    {
        #region 构造器

        public SysMenuBusiness()
        {

        }

        #endregion

        #region 公共方法
        /// <summary>
        /// 根据用户编号获得菜单
        /// </summary>
        /// <param name="userId">用户编号</param>
        /// <param name="parentId">父节点编号</param>
        /// <returns></returns>
        public List<SysMenuEntity> GetMenus(string userId, string parentId)
        {
            return DataAccess.GetMenus(userId, parentId);
        }

        /// <summary>
        /// 根据用户编号获得菜单
        /// </summary>
        /// <param name="userId">用户编号</param>
        /// <returns></returns>
        public List<SysMenuEntity> GetMenusByUserId(string userId)
        {
            return DataAccess.GetMenusByUserId(userId);
        }

        /// <summary>
        /// 根据父节点获得所有子节点
        /// </summary>
        /// <param name="parentId">父节点编号</param>
        /// <returns></returns>
        public List<SysMenuEntity> GetMenus(string parentId)
        {
            return DataAccess.GetMenus(parentId);
        }
        /// <summary>
        /// 获取同等级下的节点
        /// </summary>
        /// <param name="menuLevel">节点等级</param>
        /// <returns></returns>
        public List<SysMenuEntity> GetMenus(int menuLevel)
        {
            return DataAccess.GetMenus(menuLevel);
        }

        //public List<SysMenuEntity> GetSys_Menus()
        //{
        //    return DataAccess.GetSysMenus();
        //}

        public SysMenuEntity GetSys_Menu(string MenuID)
        {
            return DataAccess.GetSysMenu(MenuID);
        }

        //public int SaveSys_Menu(SysMenuEntity Sys_Menu)
        //{
        //    return DataAccess.SaveSysMenu(Sys_Menu);
        //}

        //public int DeleteSys_Menu(SysMenuEntity Sys_Menu)
        //{
        //    return DataAccess.DeleteSysMenu(Sys_Menu);
        //}

        #endregion
    }
}